package day11.part2;

/**
 * @Author juzipi
 * @Date 2021/6/28 8:18
 * @Info
 */
public class Worker {

    private String name = "asdh";

    private int age;

    public Worker() {
        System.out.println("默认super！！！！！！！！！");
    }

    public Worker(String name) {
        this.name = name;
    }

    public Worker(String name, int age) {
        //调用上面的构造器，扯
        this(name);
        this.age = age;
    }

    public void work(){
        System.out.println("该干活了");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Worker{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

}
